package com.xiaoshuidi.cloud.module.finance.framework.datapermission.config;

import com.xiaoshuidi.cloud.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.finance.FinanceAccountWithdrawDO;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.finance.FinanceMoneyFlowDO;
import com.xiaoshuidi.cloud.module.finance.dal.dataobject.finance.FinancePaymentChangeLogDO;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class DeptDataPermissionConfiguration {
    @Bean
    public DeptDataPermissionRuleCustomizer dataPermissionRuleCustomizer() {
        return rule -> {
            rule.addDeptColumn(FinanceMoneyFlowDO.class);
            rule.addDeptColumn(FinancePaymentChangeLogDO.class);
            rule.addDeptColumn(FinanceAccountWithdrawDO.class,"apartment_id");
        };
    }
}
